
import Vue from 'vue';
import VueRouter from 'vue-router';
Vue.use(VueRouter);
// 解决在跳转时push了相同的地址出现的错误(vue-router:3.2.0)
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err);
};
const Home = { template: '<home-clock sys-title="欢迎使用销售管理系统" copy-right=""> </home-clock>' };
const newRouter = [
    {
        path: '/',
        name: 'Home',
        component: Home
      },
      {
        path: '/salesPerson',
        name: 'salesPerson',
        meta: {
          title: '人员管理',
          name: '人员管理'
        },
        component: () => import(/* webpackChunkName: "salesPerson-page" */ 'modules/index/src/personnel-management/sales-person/sales-person')
      },
];

const createRouter = () => new VueRouter({
    // mode: 'history', // require service support
    scrollBehavior: () => ({ y: 0 }),
    // 使用扩展运算符进行合并数组
    routes: [...newRouter]
  });
  const router = createRouter();
export default router;
